AI SHOWDOWN
code:ai_showdown
const add 0
const add_ri 64
const add_ii 192
const sub 1
const sub_ri 65
const sub_ir 129
const jeq 32
const jeq_ri 96
const jeq_ii 224
const jlt 34
const jlte 35
const jgt 36
const jgte 37
const jgte_ri 101
const sw 16
const sw_ri 80
const lw 17
const lw_ri 81
const call 8
const ret 9
const r0 0
const r1 1
const r2 2
const r3 3
const r4 4
const r5 5
const sp 5
const sp_offset 4
const counter 6
const input 7
const output 7
const _ 0
const val 1
const n_cards 2
# init
add_ii 2 _ val
sw_ri r0 0 val
add_ii 3 _ val
sw_ri r0 1 val
add_ii 1 _ val
sw_ri r0 2 val
# loop
label loop
add input _ n_cards
add n_cards _ val
call sp _ mod3
lw r0 val val
add val _ output
jeq _ _ loop
label mod3
add_ii 0 _ val
ret sp _ _